package cn.mw.service.impl;

import cn.mw.domain.Floor;
import cn.mw.mapper.FloorMapper;
import cn.mw.service.IFloorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FloorServiceImpl implements IFloorService {
    @Autowired
    private FloorMapper floorMapper;
    @Override
    public void addFloor(List<Floor> floors) {
        //集合判空
        if (floors != null) {
            for (Floor floor : floors) {
                floorMapper.add(floor);
            }
        }
    }

    /**
     * 查询楼栋下的所有楼层
     * @param bulidId
     * @return
     */
    @Override
    public List<Floor> getfloor(String bulidId) {
        return floorMapper.getfloor(bulidId);
    }
}
